import { create } from "zustand"
import { getThemeColor, setThemeColor } from "@/utils/app-util"
const userThemeColor = create((set, get) => ({
  themeColor: getThemeColor(),
  updateThemeColor: (newVal) => {
    set(() => ({ themeColor: newVal }))
    setThemeColor(newVal)
  },
  // 获取主题颜色
  getThemeColor: () => get().themeColor
}))

export default userThemeColor
